<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>学生界面</title>
  <%
    String scheme = request.getScheme();
    String serverName = request.getServerName();
    int serverPort = request.getServerPort();
    String contextPath = request.getContextPath();

    String basePath = scheme + "://" + serverName + ":" + serverPort + contextPath + "/";
  %>
  <base href="<%=basePath%>">
  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js"></script>
<%--  <script>--%>
<%--    $(function () {--%>
<%--      $("#courseTable").click(function (){--%>
<%--        $.post("${pageContext.request.contextPath}/getCourseTable/${sessionScope.UID}", function (data) {--%>
<%--          $(".nav-item").children(1).removeClass("active");--%>
<%--          $("#checkItem").addClass("active");--%>
<%--          $("#courseTable").addClass("active");--%>
<%--          var html = "";--%>
<%--          console.log(data);--%>
<%--        });--%>
<%--      });--%>
<%--    });--%>
  </script>
  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <link rel="stylesheet" href="common/css/course.css">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
  <!-- Navbar -->
  <c:import url="../all/head.jsp"/>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="index3.html" class="brand-link">
      <img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light">SLOOK</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">${sessionScope.name}</a>
        </div>
      </div>

      <!-- SidebarSearch Form -->
      <div class="form-inline">
        <div class="input-group" data-widget="sidebar-search">
          <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
          <div class="input-group-append">
            <button class="btn btn-sidebar">
              <i class="fas fa-search fa-fw"></i>
            </button>
          </div>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
            data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
             with font-awesome or any other icon font library -->

          <li class="nav-item menu-open">
            <a id="checkItem" href="#" class="nav-link active">
              <i class="nav-icon fas fa-table"></i>
              <p>
                查看
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="<%=request.getContextPath()%>/getAllNotice/student" class="nav-link <c:if test="${sessionScope.action == 'student'}">active</c:if>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>公告</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="<%=request.getContextPath()%>/getWeathers" class="nav-link <c:if test="${sessionScope.action == 'weather'}">active</c:if>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>天气</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="<%=request.getContextPath()%>/getOneCourse/${sessionScope.UID}" class="nav-link <c:if test="${sessionScope.action == 'course'}">active</c:if>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>您的课程</p>
                </a>
              </li>
              <li class="nav-item">
                <a id="courseTable" href="<%=request.getContextPath()%>/getYourCourses/${sessionScope.UID}" class="nav-link <c:if test="${sessionScope.action == 'yourCourses'}">active</c:if>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>课程表</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="<%=request.getContextPath()%>/getOutCourse/${sessionScope.UID}" class="nav-link  <c:if test="${sessionScope.action == 'selectCourses'}">active</c:if>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>选课</p>
                </a>
              </li>
            </ul>
          </li>
        </ul>
        </li>

        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->

  <c:if test="${sessionScope.action == 'student'}">
    <c:import url="stuList/studentNotice.jsp"/>
  </c:if>
  <c:if test="${sessionScope.action == 'course'}">
      <c:import url="stuList/selectCourses.jsp"/>
  </c:if>
  <c:if test="${sessionScope.action == 'yourCourses'}">
    <c:import url="stuList/example.jsp"/>
  </c:if>
  <c:if test="${sessionScope.action == 'selectCourses'}">
    <c:import url="stuList/selectOutCourses.jsp"/>
  </c:if>
  <c:if test="${sessionScope.action == 'weather'}">
    <c:import url="stuList/weathers.jsp"/>
  </c:if>

  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="float-right d-none d-sm-block">
    </div>
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<script src="common/js/Timetables.min.js"></script>
</body>
</html>
